package com.workingpub.commons.datasource;

import java.io.Serializable;

/**
 * 连接池配置属性集
 * 
 * @author taoping
 *
 */
public class ConfigProperties implements Serializable {
	private static final long serialVersionUID = -882299078797293838L;

	private String domain;
	private String jdbcUrl;
	private String jdbcUser;
	private String jdbcPassword;
	private String driverClass;
	private Integer maxPoolSize;
	private Integer minPoolSize;
	private Boolean allConnectionsEquals = Boolean.TRUE;
	private Integer connectionMadIdleMinutes = 15;
	private Integer connectionMaxWaitMilliseconds = 5000;

	private DatabaseType databaseType;

	public DatabaseType getDatabaseType() {
		return databaseType;
	}

	public void setDatabaseType(DatabaseType databaseType) {
		this.databaseType = databaseType;
	}

	/**
	 * 默认值：<br>
	 * allConnectionsEquals = Boolean.TRUE;<br>
	 * connectionMadIdleMinutes = 15;<br>
	 * connectionMaxWaitMilliseconds = 5000;
	 * 
	 * @param domain
	 */
	public ConfigProperties(String domain) {
		this.domain = domain;
	}

	public String getJdbcUrl() {
		return jdbcUrl;
	}

	public void setJdbcUrl(String jdbcUrl) {
		this.jdbcUrl = jdbcUrl;
	}

	public String getJdbcUser() {
		return jdbcUser;
	}

	public void setJdbcUser(String jdbcUser) {
		this.jdbcUser = jdbcUser;
	}

	public String getJdbcPassword() {
		return jdbcPassword;
	}

	public void setJdbcPassword(String jdbcPassword) {
		this.jdbcPassword = jdbcPassword;
	}

	public String getDriverClass() {
		return driverClass;
	}

	public void setDriverClass(String driverClass) {
		this.driverClass = driverClass;
	}

	public Integer getMaxPoolSize() {
		return maxPoolSize;
	}

	public void setMaxPoolSize(Integer maxPoolSize) {
		this.maxPoolSize = maxPoolSize;
	}

	public Integer getMinPoolSize() {
		return minPoolSize;
	}

	public void setMinPoolSize(Integer minPoolSize) {
		this.minPoolSize = minPoolSize;
	}

	public Boolean getAllConnectionsEquals() {
		return allConnectionsEquals;
	}

	public void setAllConnectionsEquals(Boolean allConnectionsEquals) {
		this.allConnectionsEquals = allConnectionsEquals;
	}

	public Integer getConnectionMadIdleMinutes() {
		return connectionMadIdleMinutes;
	}

	public void setConnectionMadIdleMinutes(Integer connectionMadIdleMinutes) {
		this.connectionMadIdleMinutes = connectionMadIdleMinutes;
	}

	public Integer getConnectionMaxWaitMilliseconds() {
		return connectionMaxWaitMilliseconds;
	}

	public void setConnectionMaxWaitMilliseconds(Integer connectionMaxWaitMilliseconds) {
		this.connectionMaxWaitMilliseconds = connectionMaxWaitMilliseconds;
	}

	public String getDomain() {
		return domain;
	}

	@Override
	public String toString() {
		return new StringBuilder("Domain : " + domain).append("\tjdbcUrl : " + jdbcUrl)
				.append("\tjdbcUser : " + jdbcUser).append("\tdriverClass : " + driverClass)
				.append("\tdatabase type : " + databaseType).toString();
	}
}
